package com.njts.array;

import java.util.Arrays;

/**
 * @author David GE
 * Date  2025/11/13
数组工具类:arrays
 */
public class ArraysUtil {
    public static void main(String[] args) {

        int[] data = new int[]{10, 20, 30, 40, 50,60};
        //数组排序
        Arrays.sort(data);
        //数组转字符串
        System.out.println(Arrays.toString(data));
        //二分查找
        int index = Arrays.binarySearch(data, 30);
        System.out.println(index);
        // 填充
        Arrays.fill(data,0);
        System.out.println(Arrays.toString(data));
        // 不要造"轮子"!="不会造轮子"


    }
}
